package java67_oop3.method2;

import java.util.Scanner;

/**
 * 客户经理类
 * 
 * @author Administrator
 *
 */
public class CustManager {
	String name = "王大锤";
	String tele = "1319999999";
	// 管理的客户,最多30
	String customers[] = new String[30];

	/**
	 * 增加新客户
	 * 
	 * @param newCustomer 客户的姓名
	 */
	public void addCust(String newCustomer) {
		// Scanner in = new Scanner(System.in);
		// 找到一个空位置
		// null就是空位置
		for (int i = 0; i < customers.length; i++) {
			if (customers[i] == null) {
				customers[i] = newCustomer;
				return;// !!!!!!!!!!!!!
			}
		}
	}

	/**
	 * 打印出已经存在的客户
	 */
	public void showCustomers() {
		for (int i = 0; i < customers.length; i++) {
			if (customers[i] != null) {
				System.out.println(customers[i]);
			} else
				break;
		}
	}
}
